#include "graph.h"

Graph::Graph(QObject *parent)
    : QObject{parent}
{
    this->initGraph();
}

Graph::~Graph()
{

}

void Graph::setAxiesRanges()
{

}

void Graph::setAxiesRanges(qreal start, qreal end)
{
    graph->axisX()->setRange(start, end);
}

void Graph::initGraph()
{
    graph = new QChart();
    graphView = new MyChartView(graph);
    graphView->setBackgroundBrush(Qt::darkGray);

    graph->setBackgroundBrush(Qt::gray);
    graphSeries.append(new QLineSeries());
    graph->addSeries(graphSeries[0]);
    // graphSeries.append(new QLineSeries());
    // graphSeries.append(new QLineSeries());

    // graph->addSeries(graphSeries[0]);
    // graph->addSeries(graphSeries[1]);
    // graph->addSeries(graphSeries[2]);
    graph->legend()->hide();
    graph->createDefaultAxes();
    graph->axisY()->setRange(0.0, 20.0);
    graph->axisX()->setRange(400.0, 6000.0);



    QColor c;
    c.setRgbF(100.0, 0.0,0.0,1);
    graphSeries[0]->setColor(c);

}


